<%@ page contentType="text/html;charset=UTF-8"%>
<div id="saleInfo">
	切换动态数据月份:<select v-on:change="chengeYear()" id="yearProject">
						<option value="">请选择</option>
						<option v-for="(row,index) in dataArray" >{{row}}</option>
				   </select>
	<a href="#" v-on:click="pushDynamiSalesData()" class="btn-action-primary">推送动态数据</a> 
	<div class="content-box margin-bottom-20  border-all">
		<h3 class="detail-header border-bottom">静态销售信息</h3>
        <table class="detail-content detail-normal-content">
            <tr>
                <td>
                    <div class="td-title fl">项目/分期推广名：</div>
                    <div class="td-content fl">{{projectPmo.promotName}}</div>
                </td>
                <td>
                    <div class="td-title fl td-title-w112">物业公司：</div>
                    <div class="td-content fl td-title-w327">{{project.propertyCompany}}</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="td-title fl">售楼地址：</div>
                    <div class="td-content fl">{{project.salesAddress}}</div>
                </td>
                <td>
                    <div class="td-title fl">销售热线：</div>
                    <div class="td-content fl">{{project.salesHotline}}</div>
                </td>
                <tr>
                    <td>
                        <div class="td-title fl">车位配比：</div>
                        <div class="td-content fl">{{staticSalesData.parkinRatio}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">自持面积：</div>
                        <div class="td-content fl">{{staticSalesData.selfSustaiAcreag}}</div>
                    </td>
                </tr>
                 <tr>
                    <td>
                        <div class="td-title fl">栋数：</div>
                        <div class="td-content fl">{{staticSalesData.numberOfBuildi}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">总户数：</div>
                        <div class="td-content fl">{{staticSalesData.totalHouse}}</div>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <div class="td-title fl">车位数：</div>
                        <div class="td-content fl">{{staticSalesData.numberOfParkinSpace}}</div>
                    </td>
                    
                  
                </tr>
                
                 <tr>
                    <td>
                        <div class="td-title fl">地上机动车位：</div>
                        <div class="td-content fl">{{staticSalesData.groundVechicParkinSpace}}</div>
                    </td>
                    <td>
                        <div class="td-title fl">地下机动车位：</div>
                        <div class="td-content fl">{{staticSalesData.undergVechicParkinSpace}}</div>
                    </td>
                  
                </tr>
                
                
                  <tr>
                    <td>
                        <div class="td-title fl">地上非机动车位：</div>
                        <div class="td-content fl">{{staticSalesData.groundNonVechicParkinSpace}}</div>
                    </td>
                    <td>
                        <div class="td-title fl">地下非机动车位：</div>
                        <div class="td-content fl">{{staticSalesData.undergNonVechicParkinSpace}}</div>
                    </td>
                  
                </tr>
                 <tr>
                    <td>
                        <div class="td-title fl">可售面积：</div>
                        <div class="td-content fl">{{staticSalesData.salableAcreag}}</div>
                    </td>
                    
                     <td>
                        <div class="td-title fl">可售套数：</div>
                        <div class="td-content fl">{{staticSalesData.salableNumber}}</div>
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <div class="td-title fl">地上可售面积：</div>
                        <div class="td-content fl">{{staticSalesData.groundSalesAcreag}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">地下可售面积：</div>
                        <div class="td-content fl">{{staticSalesData.undergSalesAcreag}}</div>
                    </td>
                </tr>
                
                <tr v-for="(row,index) in staticSalesData.targetAveragPrice">
                    <td>
                        <div class="td-title fl">目标销售均价：</div>
                        <div class="td-content fl" >{{row.targetAveragPrice}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">生效时间({{row.targetAveragPriceVersion}}):</div>
                        <div class="td-content fl">{{row.effectStartTime}}</div>
                    </td>
                </tr>
                
                <tr v-for="(row,index) in staticSalesData.targetPriceOfParkinSpace">
                    <td>
                        <div class="td-title fl">车位目标销售均价：</div>
                        <div class="td-content fl" >{{row.targetPriceOfParkinSpace}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">生效时间({{row.targetPriceOfParkinVersion}}):</div>
                        <div class="td-content fl">{{row.effectStartTime}}</div>
                    </td>
                </tr>
                
                 <tr v-for="(row,index) in staticSalesData.targetValue">
                    <td>
                        <div class="td-title fl">目标货值：</div>
                        <div class="td-content fl" >{{row.targetValue}}</div>
                    </td>
                    
                    <td>
                        <div class="td-title fl">生效时间({{row.targetValueVersion}}):</div>
                        <div class="td-content fl">{{row.effectStartTime}}</div>
                    </td>
                </tr>
                
                  
		</table>
	</div>
      <div class="content-box margin-bottom-20">
            <h3 class="detail-header border-all border-bottom-none">销售指标信息</h3>
            <table class="detail-table">
            <tr class="bg-gray">
                <th class="column1" width="10%">月份</th>
                <th class="column2" width="15%">计划销售额(万元)</th>
                <th class="column3" width="15%">汇总实际销售额(万元)</th>
                <th class="column4" width="20%">差额(万元)</th>
                <th class="column5" width="20%">偏差原因</th>
                <th class="column6" width="20%">操作</th>
            </tr>
            <tr v-for="srpSale in srpSaleMap">
                <td class="column1">{{srpSale.saleMonth}}月</td>
                <td class="column2 table-number">{{srpSale.salePlan}}</td>
                <td class="column3 table-number">{{srpSale.saleActual}}</td>
                <td class="column4 table-number">{{srpSale.saleDiff}}</td>
                <td class="column5">{{srpSale.saleDiffReason}}</td>
                <td class="column6">
                	<a href="#" v-on:click="dynamiSalesInfo(srpSale.id,$event)" class="btn-edit">编辑</a>
                </td>
            </tr>
            
             <tr >
                <th class="column1" width="10%">汇总</th>
                <th class="column2 table-number" width="15%">{{saleTotal.salePlanAmount}}</th>
                <th class="column3 table-number" width="15%">{{saleTotal.salePlanTrueAmount}}</th>
                <th class="column4 table-number" width="20%">{{saleTotal.salePlanDifference}}</th>
                <th class="column5" width="20%"></th>
                <th class="column6" width="20%"></th>
            </tr>
           
        </table>
    </div>
    <div class="content-box margin-bottom-20">
        <h3 class="detail-header border-all border-bottom-none">回款指标信息</h3>
        <table class="detail-table">
            <tr class="bg-gray">
                <th class="column1" width="10%">月份</th>
                <th class="column2" width="15%">计划回款额(万元)</th>
                <th class="column3" width="15%">汇总实际回款额(万元)</th>
                <th class="column4" width="20%">差额(万元)</th>
                <th class="column5" width="20%">偏差原因</th>
                <th class="column6" width="20%">操作</th>
            </tr>
            <tr v-for="srpReturn in srpReturnMap">
                <td class="column1">{{srpReturn.saleMonth}}月</td>
                <td class="column2 table-number">{{srpReturn.salePlan}}</td>
                <td class="column3 table-number">{{srpReturn.saleActual}}</td>
                <td class="column4 table-number">{{srpReturn.saleDiff}}</td>
                <td class="column5">{{srpReturn.saleDiffReason}}</td>
                <td class="column6">
                    <a href="#" v-on:click="dynamiSalesInfo(srpReturn.id,$event)" class="btn-edit">编辑</a>
                </td>
            </tr>
             <tr >
                <th class="column1" width="10%">汇总</th>
                <th class="column2 table-number" width="15%">{{backTotal.backPlanAmount}}</th>
                <th class="column3 table-number" width="15%">{{backTotal.backTrueAmount}}</th>
                <th class="column4 table-number" width="20%">{{backTotal.backDifference}}</th>
                <th class="column5" width="20%"></th>
                <th class="column6" width="20%"></th>
            </tr>
        </table>
    </div>
    <div class="content-box margin-bottom-20 border-all">
        <h3 class="detail-header border-bottom">动态销售数据汇总</h3>
        <table class="detail-content sale-data">
        	<tr>
        		 <td>
                    <div class="td-title fl">目标货值汇总：</div>
                    <div class="td-content fl">{{targetValue.targetValue}}</div>
                </td>
                
                <td>
                    <div class="td-title fl">动态货值汇总：</div>
                    <div class="td-content fl">{{dynamiData.dynamiValue}}</div>
                </td>
            	</tr>
            <tr>
            
            
                <td>
                    <div class="td-title fl">房间目标货值：</div>
                    <div class="td-content fl">{{targetValue.targetValue}}</div>
                </td>
                <td>
                    <div class="td-title fl">房间动态货值：</div>
                    <div class="td-content fl">{{dynamiData.dynamiValue}}</div>
                </td>
            </tr>
            
             <tr>
                <td>
                    <div class="td-title fl">已售面积：</div>
                    <div class="td-content fl">{{dynamiData.soldAcreag}}</div>
                </td>
                <td>
                    <div class="td-title fl">未售面积：</div>
                    <div class="td-content fl">{{dynamiData.unsoldArea}}</div>
                </td>
            </tr>
            
            
            <tr>
                <td>
                    <div class="td-title fl">未来销售最低均价：</div>
                    <div class="td-content fl">{{dynamiData.lowestAveragPriceInFuture}}</div>
                </td>
                <td>
                    <div class="td-title fl">动态均价：</div>
                    <div class="td-content fl">{{dynamiData.dynamiAveragPrice}}</div>
                </td>
            </tr>
            <tr>
            	<td>
            		   <div class="td-title fl">差额：</div>
            		   <div class="td-content fl" v-if="dynamiData.difference!=0">{{dynamiData.difference}}</div>
            	</td>
            </tr>
            
            
               <tr>
                <td>
                    <div class="td-title fl">车位目标货值：</div>
                    <div class="td-content fl"></div>
                </td>
                <td>
                    <div class="td-title fl">车位动态货值：</div>
                    <div class="td-content fl">{{dynamiData.cwDynamiValue}}</div>
                </td>
            </tr>
             <tr>
                <td>
                    <div class="td-title fl">已售车位数：</div>
                    <div class="td-content fl" v-if="dynamiData.soldParkinSpace!=0">{{dynamiData.soldParkinSpace}}</div>
                </td>
                <td>
                    <div class="td-title fl">未售车位数：</div>
                    <div class="td-content fl" v-if="dynamiData.cwUnsoldParkinSpace!=0">{{dynamiData.cwUnsoldParkinSpace}}</div>
                </td>
            </tr>
            
            <tr>
                <td>
                    <div class="td-title fl">车位未来销售最低均价：</div>
                    <div class="td-content fl">{{dynamiData.cwLowestAveragPriceInFuture}}</div>
                </td>
                <td>
                    <div class="td-title fl">车位动态均价：</div>
                    <div class="td-content fl">{{dynamiData.averagPriceOfParkinSpace}}</div>
                </td>
            </tr>
             <tr>
            	<td>
            		   <div class="td-title fl">差额：</div>
            		   <div class="td-content fl" v-if="dynamiData.cwDifference!=0">{{dynamiData.cwDifference}}</div>
            	</td>
            </tr>
            
            
	            
        </table>
       <!--  <div class="detail-link border-top"><a href="STAGE_item-info.html" class="link-more">查看各业态实际导入房源数据>></a></div> -->
    </div>
    
    
    <div class="content-box margin-bottom-20 border-all" v-for="(row,index) in salesIndustData">
        <h3 class="detail-header border-bottom">业态销售数据
         <a style="text-decoration: none;" onclick="createIndustModel(this,'${id}',null,null,true,0)" v-bind:id="row.id">编辑业态</a>
         
         <a style="text-decoration: none;" onclick="deleteIndust(this,true)" v-bind:id="row.id">删除业态</a>
         </h3>
        <table class="detail-content sale-data">
         <tr>
                <td>
                    <div class="td-title fl">大业态类型：</div>
                    <div class="td-content fl">{{row.industValue}}</div>
                </td>
                <td>
                    <div class="td-title fl">小业态类型：</div>
                    <div class="td-content fl">{{row.industKey}}</div>
                </td>
            </tr>
        	<tbody v-if="row.industKey!='车位'"> 
        	
            <tr>
                <td>
                    <div class="td-title fl">总户数：</div>
                    <div class="td-content fl">{{row.industData.totalHouse}}</div>
                </td>
                <td>
                    <div class="td-title fl">栋数：</div>
                    <div class="td-content fl">{{row.industData.numberOfBuildi}}</div>
                </td>
            </tr>
            <tr >
                <td>
                    <div class="td-title fl">可售面积(万m2)：</div>
                    <div class="td-content fl">{{row.industData.salableAcreag}}</div>
                </td>
                <td>
                    <div class="td-title fl">可售套数(套)：</div>
                    <div class="td-content fl">{{row.industData.numberLayers}}</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="td-title fl">自持面积(万m2)：</div>
                    <div class="td-content fl">{{row.industData.selfSustaiAcreag}}</div>
                </td>
                <td>
                    <div class="td-title fl">自持货值：</div>
                    <div class="td-content fl">{{row.industData.targetValue}}</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="td-title fl">地上可售面积(万m2)：</div>
                    <div class="td-content fl">{{row.industData.groundSalesAcreag}}</div>
                </td>
                
                 <td>
                    <div class="td-title fl">地下可售面积(万m2)：</div>
                    <div class="td-content fl">{{row.industData.undergSalesAcreag}}</div>
                </td>
               
            </tr>
        	</tbody>
        	<tbody v-if="row.industKey=='车位'">
        	 	<tr >
                <td>
                    <div class="td-title fl">可售车位数(个)：</div>
                    <div class="td-content fl">{{row.industData.salableAcreag}}</div>
                </td>
                
                  <td>
                    <div class="td-title fl">自持货值：</div>
                    <div class="td-content fl">{{row.industData.targetValue}}</div>
                </td>
                </tr>
        	</tbody>
           <tr>
             <td>
                    <div class="td-title fl">目标销售均价：</div>
                    <div class="td-content fl">{{row.industData.targetAveragPrice}}</div>
                </td>
                <td>
                    <div class="td-title fl">版本：</div>
                    <div class="td-content fl">{{row.industData.targetVersionName}}</div>
                </td>
            </tr>
           
        </table>
    </div>
    <div class="content-box border-all" v-for="(row,index) in dynamiExtendList">
        
        <h3 class="detail-header border-top border-bottom">动态销售数据</h3>
        <table class="detail-content sale-data">
            
               <tr style="width: 100%;">
                <td>
                    <div class="td-title fl">大业态类型：</div>
                    <div class="td-content fl">{{row.industKey}}</div>
                </td>
                <td>
                    <div class="td-title fl">小业态类型：</div>
                    <div class="td-content fl">{{row.industValue}}</div>
                </td>
            </tr>
            
         	<tbody v-if="row.industValue!='车位'">
         		   <tr>
                <td>
                    <div class="td-title fl">已售面积：</div>
                    <div class="td-content fl">{{row.soldAcreag}}</div>
                </td>
                <td>
                    <div class="td-title fl">未售面积：</div>
                    <div class="td-content fl">{{row.totalNoCalculateArea}}</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="td-title fl">实际销售额：</div>
                    <div class="td-content fl">{{row.monthActualSalesAmount}}</div>
                </td>
                <td>
                    <div class="td-title fl">实际回款额：</div>
                    <div class="td-content fl">{{row.monthActualBackAmount}}</div>
                </td>
            </tr>
            <tr>
                <td>
                    <div class="td-title fl">动态货值：</div>
                    <div class="td-content fl">{{row.dynamiValue}}</div>
                </td>
                <td>
                    <div class="td-title fl">动态均价：</div>
                    <div class="td-content fl">{{row.dynamiAveragPrice}}</div>
                </td>
            </tr>
            <tr>
            	 <td>
                    <div class="td-title fl">目标货值：</div>
                    <div class="td-content fl" v-if="row.targetValue != null">{{row.targetValue[0].targetValue}}</div>
                    <div class="td-content fl" v-else></div>
                </td>
                <td>
                    <div class="td-title fl">未来销售最低均价：</div>
                    <div class="td-content fl">{{row.lowestAveragPriceInFuture}}</div>
                </td>
            </tr>
          
         
            <tr>
            
            	 <td>
                    <div class="td-title fl">差额(万元)：</div>
                    <div class="td-content fl" v-if="row.difference!=0">{{row.difference}}</div>
                </td>
                <td >
                    <div class="td-title fl">偏差原因：</div>
                    <div class="td-content fl">{{row.deviationRemake}}</div>
                </td>
            </tr> 
         	</tbody >
         	
         	<tbody v-if="row.industValue=='车位'">
         		<tr>
         			<td>
                    <div class="td-title fl">已售车位数(个)：</div>
                    <div class="td-content fl" v-if="row.soldParkinSpace!=0">{{row.soldParkinSpace}}</div>
                	</td>
                	
                	<td>
                    <div class="td-title fl">未售车位数(个)：</div>
                    <div class="td-content fl" v-if="row.totalNoCalculateArea!=0">{{row.totalNoCalculateArea}}</div>
                	</td>
                	
         		</tr>
         		  <tr>
                <td>
                    <div class="td-title fl">实际销售额(万元)：</div>
                    <div class="td-content fl">{{row.monthActualSalesAmount}}</div>
                </td>
                <td>
                    <div class="td-title fl">实际回款额(万元)：</div>
                    <div class="td-content fl">{{row.monthActualBackAmount}}</div>
                </td>
           	 </tr>
           	 
           	  <tr>
                <td>
                    <div class="td-title fl">车位动态货值(万元)：</div>
                    <div class="td-content fl">{{row.cwDynamiAveragPrice}}</div>
                </td>
                <td>
                    <div class="td-title fl">车位动态均价(万元)：</div>
                    <div class="td-content fl">{{row.averagPriceOfParkinSpace}}</div>
                </td>
           	 </tr>
           	 
           	 
           	  <tr>
                <td>
                    <div class="td-title fl">车位目标货值(万元)：</div>
                    <div class="td-content fl" v-if="row.targetValue">{{row.targetValue[0].targetValue}}</div>
                    <div class="td-content fl" v-else></div>
                </td>
                <td>
                    <div class="td-title fl">车位未来销售最低均价：</div>
                    <div class="td-content fl">{{row.lowestAveragPriceInFuture}}</div>
                </td>
           	 </tr>
         		<tr>
            	<td>
                    <div class="td-title fl">差额(万元)：</div>
                    <div class="td-content fl" v-if="row.cwDifference!=0">{{row.cwDifference}}</div>
                </td>
                <td >
                    <div class="td-title fl">偏差原因：</div>
                    <div class="td-content fl">
                    	{{row.deviationRemake}}
                    </div>
                </td>
            	</tr>
         		<tr>
         			<td></td>
         		</tr>
         	</tbody>
        </table>
    </div>
</div>
<div id="editPlan" style="display: none;">
	<table style="margin-top: 30px;">
		<tr>
			<td style="width: 20%"></td>
			<td style="width: 80%"><textarea id="saleDiffReason"   style="width: 200px;height: 100;" ></textarea></td>
		</tr>
	</table>
</div>
<script type="text/javascript">
	
	Vue.filter('moment', function (value, formatString) {
		if(!value){
			return "";
		}
		formatString = formatString || 'YYYY年MM月DD';
	    return moment(value).format(formatString);
	});

	var projectInfo = new Vue({
		el: '#saleInfo',
		data: {
			projectId: "${id}",
			project: {},
			projectPmo: {},
			staticSalesData: {}, //静态销售数据
			srpSaleMap: {}, //銷售
			srpReturnMap: {}, //回款
			salesIndustData:[],
			dynamiExtendList:[], //每个业态的动态数据
			dynamiData:{}, //动态数据汇总
			targetValue:{},
			dataArray:[],
			saleTotal:{
				salePlanAmount:0,
				salePlanTrueAmount:0,
				salePlanDifference:0
			},
			backTotal:{
				backPlanAmount:0,
				backTrueAmount:0,
				backDifference:0
			}
		},
		mounted:function(){
			var _self = this;
			_self.loadSaleView();
			var value = moment(new Date()).format("YYYY-MM-DD");
			_self.getDateArray('2017-01-01',value);
		},
		created:function(){
		},
		methods: {
			loadSaleView: function() {
				var loadIndex = layer.load(0, {shade: false});
		        var _self = this;
		    	var params={};
		    	var apiUrl = "${pageContext.request.contextPath}/estate/project/loadSaleView";
		    	var year = $("#yearProject").find("option:selected").text();
		    	var calYearMonth = "";
		    	if(year!="请选择"){
		    		calYearMonth = year;
		    	}
		    	$.post(apiUrl, {id: _self.projectId,calYearMonth:calYearMonth}, function(data){
		    		layer.close(loadIndex);
		    		 var result = JSON.parse(data);
		    		_self.project = result.project;
		    		_self.projectPmo = result.projectPmo;
		    		_self.staticSalesData = result.staticSalesData;
		    		_self.srpSaleMap = result.srpSaleMap;
		    		var salePlanAmount = 0;
		    		var salePlanTrueAmount = 0;
		    		var salePlanDifference = 0;
		    		if(result.srpSaleMap!=null){
		    			for(var i=0;i<result.srpSaleMap.length;i++){
			    			salePlanAmount+=parseFloat(result.srpSaleMap[i].salePlan);
			    			salePlanTrueAmount+=parseFloat(result.srpSaleMap[i].saleActual);
			    			salePlanDifference+=parseFloat(result.srpSaleMap[i].saleDiff);
			    		}
		    		}
		    		
		    		_self.saleTotal.salePlanAmount=salePlanAmount.toFixed(6);
		    		_self.saleTotal.salePlanTrueAmount=salePlanTrueAmount.toFixed(6);
		    		_self.saleTotal.salePlanDifference=salePlanDifference.toFixed(6);
		    		
		    		var backPlanAmount = 0;
		    		var backTrueAmount = 0;
		    		var backDifference = 0;
		    		if(result.srpReturnMap!=null){
		    			for(var i=0;i<result.srpReturnMap.length;i++){
			    			backPlanAmount+=parseFloat(result.srpReturnMap[i].salePlan);
			    			backTrueAmount+=parseFloat(result.srpReturnMap[i].saleActual);
			    			backDifference+=parseFloat(result.srpReturnMap[i].saleDiff);
			    		}	
		    		}
		    		
		    		_self.backTotal.backPlanAmount=backPlanAmount.toFixed(6);
		    		_self.backTotal.backTrueAmount=backTrueAmount.toFixed(6);
		    		_self.backTotal.backDifference=backDifference.toFixed(6);
		    		_self.srpReturnMap = result.srpReturnMap;
		    		_self.salesIndustData = result.staticSalesData.indust;
		    		_self.dynamiExtendList = result.levelDynamiSalesData.data.dynamiExtend;
		    		_self.dynamiData = result.levelDynamiSalesData.data;
		    		if(_self.dynamiData.targetValue != null){
		    			_self.targetValue = _self.dynamiData.targetValue[0];
		    		}
				});
			},
			dynamiSalesInfo:function(id,e){
				var _self = this;
				JY.Model.edit("editPlan",'偏差原因',function(){
					var saleDiffReason = $("#saleDiffReason").val();
					if(null==saleDiffReason||saleDiffReason==""){
						layer.alert("请填写原因");
					}else{
						var params = {
								id:id,
								saleDiffReason:$("#saleDiffReason").val()
						};
						$("#editPlan").dialog("close");
						var url = '${pageContext.request.contextPath}/estate/project/editSalesReturnPlant';
						$.ajax({
							  type: "POST",
					          url: url,
					          data: params,
					          dataType: "json",
					          success: function(data){
					        	  _self.loadSaleView();
					        	  layer.alert(data.resMsg);
					          }
						});
					}
				});
			},
			getDateArray:function(d1,d2){
				var _self = this;
                var dateArry = new Array();
                var s1 = d1.split("-");
                var s2 = d2.split("-");
                var mCount = 0;
                if (parseInt(s1[0]) < parseInt(s2[0])) {
                    mCount = (parseInt(s2[0]) - parseInt(s1[0])) * 12 + parseInt(s2[1]) - parseInt(s1[1])+1;
                } else {
                    mCount = parseInt(s2[1]) - parseInt(s1[1])+1;
                }
                if (mCount > 0) {
                    var startM = parseInt(s1[1]);
                    var startY = parseInt(s1[0]);
                    for (var i = 0; i < mCount; i++) {
                        if (startM < 12) {
                            dateArry[i] = startY + "" + (startM>9 ? startM : "0" + startM);
                            startM += 1;
                        } else {
                            dateArry[i] = startY + "" + (startM > 9 ? startM : "0" + startM);
                            startM = 1;
                            startY += 1;
                        }
                    }
                }
                _self.dataArray = dateArry;
			},chengeYear:function(){
				 var _self = this;
				 _self.loadSaleView();
			},pushDynamiSalesData:function(){
				var year = $("#yearProject").find("option:selected").text();
				var _self = this;
		    	if(year=="请选择"){
		    		layer.alert("请选择月份推送!");
		    	}else{
		    		var params = {
		    				month:year,
		    				pmoProjectCode:_self.projectPmo.pmoProjectCode
		    		};
		    		var url = "${pageContext.request.contextPath}/estate/project/testSendDynamiPmo";
		    		$.ajax({
						 type: "POST",
				         url: url,
				         data: params,
				         dataType: "json",
				         success: function(data){
				         	layer.alert("日期"+year+"推送成功!");
				         }
					});
		    	}
			
			}
		}
	});
</script>
